package com.blockchain.console.service.financial;

import java.io.OutputStream;

import com.blockchain.common.enums.WithdrawStatus;
import com.blockchain.console.service.financial.entity.BankCard;
import com.blockchain.console.service.financial.entity.TxglRecord;
import com.blockchain.console.service.financial.query.TxglRecordQuery;
import com.blockchain.console.service.system.entity.Bank;
import com.blockchain.framework.service.Service;
import com.blockchain.framework.service.query.Paging;
import com.blockchain.framework.service.query.PagingResult;

public interface TxglManage extends Service {


	/**
	 * 查询所有银行卡
	 * 
	 * @return
	 * @throws Throwable
	 */
	public Bank[] getBanks() throws Throwable;
	
	/**
	 * 查询连连所有银行
	 * @return
	 * @throws Throwable
	 */
	public Bank[] getBanks_() throws Throwable;

	/**
	 * <dt>
	 * <dl>
	 * 描述： 查询提现列表
	 * </dl>
	 * </dt>
	 * 
	 * @param query
	 *            提现查询接口
	 * @param paging
	 *            分页对象
	 * @return PagingResult<UserExtractionRecord> 提现分页集合
	 * @throws Throwable
	 */
	public PagingResult<TxglRecord> search(TxglRecordQuery query, Paging paging)
			throws Throwable;

	/**
	 * 查询提现详细
	 * 
	 * @param id
	 * @return
	 * @throws Throwable
	 */
	public TxglRecord get(int id) throws Throwable;

	/**
	 * <dt>
	 * <dl>
	 * 描述： 批量审核提现记录
	 * </dl>
	 * </dt>
	 * 
	 * @param serialNumberItem
	 *            提现流水号集合
	 * @param flag
	 *            审核标志
	 * @throws Throwable
	 */
	public void checkBatch(WithdrawStatus status, String check_reason,
			int... ids) throws Throwable;

	/**
	 * <dt>
	 * <dl>
	 * 描述： 单个审核提现记录
	 * </dl>
	 * </dt>
	 * 
	 * @param serialNumber
	 *            提现流水号
	 * @param flag
	 *            审核标志
	 * @throws Throwable
	 */
	public void check(WithdrawStatus status, String check_reason, int id)
			throws Throwable;

	/**
	 * <dt>
	 * <dl>
	 * 描述： 导出提现审核通过
	 * </dl>
	 * </dt>
	 * 
	 * @param txglRecord
	 *            审核通过记录
	 * @param type
	 *          导出信息类别
	 * @throws Throwable
	 */
	public void export(TxglRecord[] txglRecord, OutputStream outputStream,
			String charset,String type) throws Throwable;
	
	
	/**
	 * 获取当前用户提现银行卡信息
	 * @return
	 * @throws Throwable
	 */
	public abstract BankCard getCard(int id) throws Throwable;
	
	/**
	 * 通过银行卡获取
	 * @param bankcard
	 * @return
	 * @throws Throwable
	 */
	public abstract BankCard getCard(String bankcard) throws Throwable;
	
	
	/**
	 * 修改用户银行卡绑定
	 * @param userid
	 * @param bankid
	 * @param llbankid
	 * @param khdz
	 * @param khh
	 * @param yhkh
	 * @return
	 * @throws Throwable
	 */
	public abstract void updateCard(int id,int userid,int bankid,int llbankid,String khdz,String khh,String yhkh) throws Throwable;
	
	/**
	 * 添加新的银行卡
	 * @param id
	 * @param userid
	 * @param bankid
	 * @param llbankid
	 * @param khdz
	 * @param khh
	 * @param yhkh
	 * @return
	 * @throws Throwable
	 */
	public abstract void addCard(int userid,int bankid,int llbankid,String khdz,String khh,String yhkh) throws Throwable;
}
